// A.cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;

  if (n < 3) {
    cout << "No" << endl;
    return 0;
  }
  
  s = s.substr(n - 3);
  if (s == "tea")
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}